package com.yunxiangyue.User_room

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.yunxiangyue.User


@Dao
abstract class UserDao {
    @Insert
    abstract fun insertUser(user: User):Long

    @Query("select * from User where phone=:phone")
    abstract fun queryUserByPhone_list(phone:String): List<User>

    @Query("select * from User where phone=:phone")
    abstract fun queryUserByPhone(phone:String): Int

    @Query("select * from User")
    abstract fun queryAll():Int

    @Update
    abstract fun updateUser(user:User):Int
}

